﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

[XmlRoot("Root")]
[Serializable]
public class GameInfo
{
	public List<LevelInfo> levels;

	public LevelInfo this[int id]
	{
		get
		{
			LevelInfo level = null;
			for (int i = 0, length = levels.Count; i < length; i++)
			{
				if (levels[i].ID == id)
				{
					level = levels[i];
				}
			}
			if (level == null)
			{
				MyLog.LogError("Error : Level Data Doesn't Exist, Level ID : " + id);
			}

			return level;
		}
	}

	public bool Contains(int id)
	{
		return levels.Count > id;
	}
}

